package org.yunshang.customer.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.converters.url.UrlImageConverter;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.yunshang.customer.domain.TCustomer;
import org.yunshang.common.excel.annotation.ExcelDictFormat;
import org.yunshang.common.excel.convert.ExcelDictConvert;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.net.URL;


/**
 * 客户信息视图对象 t_customer
 *
 * @author Lion Li
 * @date 2024-03-28
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = TCustomer.class)
public class TCustomerVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    /*@ExcelProperty(value = "主键")*/
    private Long id;

    /**
     * 名称
     */
    @ExcelProperty(value = "名称")
    private String name;

    /**
     * 全称
     */
    @ExcelProperty(value = "全称")
    private String bigName;

    /**
     * 类型(0：其他，1：自主品牌， 2：经销商，3：工厂)
     */
    @ExcelProperty(value = "类型", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=其他,1=自主品牌,2=经销商,3=工厂")
    private String leixing;

    /**
     * 联系人
     */
    @ExcelProperty(value = "联系人")
    private String people;

    /**
     * 联系电话
     */
    @ExcelProperty(value = "联系电话")
    private String phone;

    /**
     * 网址
     */
    @ExcelProperty(value = "网址")
    private String url;

    /**
     * emal
     */
    @ExcelProperty(value = "emal")
    private String email;

    /**
     * 地址
     */
    @ExcelProperty(value = "地址")
    private String address;

    /**
     * facebook
     */
    @ExcelProperty(value = "facebook")
    private String facebook;

    /**
     * 主要销售市场
     */
    @ExcelProperty(value = "主要销售市场")
    private String cellAddress;

    /**
     * log图id
     */
    @ExcelIgnore
    private String log;

    @ExcelIgnore
    private String logUrl;

    /**
     * 状态(0：启用，1：禁用)
     */
    @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=启用,1=禁用")
    private String status;

    /**
     * 业务跟单员
     */
    @ExcelProperty(value = "业务跟单员")
    private Long businessUserId;

    /**
     * 税点
     */
    @ExcelProperty(value = "税点")
    private BigDecimal tax;

    /**
     * 辅料备注
     */
    @ExcelProperty(value = "辅料备注")
    private String fuliaoRemarks;

    /**
     * 付款方式（0：现金，1：月结）
     */
    @ExcelProperty(value = "付款方式", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=现金,1=月结")
    private String pay;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remark;

    @ExcelProperty(value = "log图", converter = UrlImageConverter.class )
    //通过注释设置单元格宽和高
    /*@ColumnWidth(50)*/
    private URL logWebUrl;
}
